package com.stormrage.entity.adm.rep;

import java.io.Serializable;

import com.stormrage.entity.adm.AdmRes;

public class AdmResRep implements Serializable {

	// ------------------------------- Fields -------------------------------

	private static final long serialVersionUID = 8727519669969971980L;

	// ------------------------------- Fields -------------------------------

	private Integer id;

	private Integer pId;

	private String name;

	private Boolean checked;

	// ------------------------------- Fields -------------------------------

	public AdmResRep() {
	}

	// ------------------------------- Fields -------------------------------

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getpId() {
		return pId;
	}

	public void setpId(Integer pId) {
		this.pId = pId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Boolean getChecked() {
		return checked;
	}

	public void setChecked(Boolean checked) {
		this.checked = checked;
	}

	// ------------------------------- Fields -------------------------------

	public static AdmResRep instance(AdmRes arg0, Boolean b) {
		AdmResRep entity = new AdmResRep();
		entity.setId(arg0.getId());
		entity.setpId(arg0.getParentId());
		entity.setName(arg0.getRes());
		if (b)
			entity.setChecked(b);
		return entity;
	}

	@Override
	public String toString() {
		return this.getClass() + " : id - " + id + " pId - " + pId + " name - " + name + " checked - " + checked;
	}

}
